home *** CD-ROM | disk | FTP | other *** search
- Newsgroups: comp.lang.c++
- Path: twisto.eng.hou.compaq.com!news
- From: Saurabh Dixit <saurabhd@bangate.compaq.com>
- Subject: Re: destructots and VC++
- Message-ID: <30FFEDF3.2BC9@bangate.compaq.com>
- Sender: news@twisto.eng.hou.compaq.com (System Administrator)
- Mime-Version: 1.0
- X-Mailer: Mozilla 2.0b5 (WinNT; I)
- Content-Type: text/plain; charset=us-ascii
- Organization: Compaq Computer Corporation
- Date: Fri, 19 Jan 1996 19:16:03 GMT
- References: <4doem9$7a8@zephyr.ens.tek.com>
- X-Nntp-Posting-Host: 172.18.176.8
- Content-Transfer-Encoding: 7bit
-
- Err...
- I wasn't even aware that constructors/destructors could
- be invoked directly on objects from outside.
- In fact I remember a few years back when I was in school
- I tried to call the constructor on one of my objects to
- re-initialize it and when my gnu++ croaked someone responded
- to my query in this newsgroup to set me straight.
-
- Regarding VC++ I know the following works in 4.0
-
- class A {
- int a;
- int b;
- public:
- A (int _a)
- {
- a = 4;
- A ();
- }
- A ()
- {
- b = 4;
- };
- };
-
- So from within the class, calling a constructor seems to work.
- So maybe I'm thinking constructors and destructors can be
- explicitly invoked from within the class but not from outside?
- Anyone care to comment?
-
- Of course, I may be full of .... since the original poster
- claims calling a destructor explicitly from outside is
- supposed to work as it is the standard.
-
- Thank you for your time
- saurabh
- --
- Saurabh Dixit
- "All opinions are always my own..."
- Compaq Computer Corporation
- ----------------------------------------------------------------
- --------
- Thou who sneezes without kerchief takes matters in own hands.
- - SomeoneIOnceNew
- ----------------------------------------------------------------
- --------
- xxxx
-